LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-15-2016, 03:42 PM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,179

Rep: Reputation: 236Reputation: 236Reputation: 236
[Bug] Slackware64-14.2 gcc fails to link with libmvec_nonshared.a


Hello,

The "/usr/lib64/libm.so" is a link to "/lib64/libm.so.6", which causes link failure. This file should probably be a script instead:
Code:
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libm.so.6  AS_NEEDED ( /usr/lib64/libmvec_nonshared.a /lib64/libmvec.so.1 ) )
according to this discussion.
 
Old 08-16-2016, 08:22 AM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Good Catch guanx !

In the slackware64/l/glibc-2.23-x86_64-1.txz Package, the original content of usr/lib64/libm.so is:

Code:
# cd /tmp && mkdir glibc-2.23 && cd glibc-2.23 && tar xvf /home/dld/slackware/slackware-14.2-64/slackware64/l/glibc-2.23-x86_64-1.txz
# file usr/lib64/libm.so

usr/lib64/libm.so: ASCII text

# cat usr/lib64/libm.so

/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libm.so.6  AS_NEEDED ( /usr/lib64/libmvec_nonshared.a /lib64/libmvec.so.1 ) )
It looks like the original content of usr/lib64/libm.so was overwritten by the install/doinst.sh script for glibc.

Also broken in my multilib glibc-2.23_multilib-x86_64-1alien

I wonder why they would name an ld script with a .so extent ?

And I wonder if there are other .so files like this in the original build ?

-- kjh

Last edited by kjhambrick; 08-16-2016 at 08:28 AM. Reason: I wonder why ... and I wonder if ...
 
Old 08-16-2016, 08:47 AM   #3
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Answer my own Q ...

These are the .so files in the original gcc-2.23 Package that are not Shared Object Libs:

Code:
# file $(find . -type f -iname "*.so") |grep -v 'ELF 64-bit LSB shared object'

./usr/lib64/libc.so:                      ASCII text
./usr/lib64/libm.so:                      ASCII text
./usr/lib64/libpthread.so:                ASCII text
These are the types of the same files in the main file system:

Code:
# file $(file $(find . -type f -iname "*.so") |grep -v 'ELF 64-bit LSB shared object' |gawk -F ':' '{ gsub( /^./, "", $1 ) ; print $1 }')
/usr/lib64/libc.so:       ASCII text
/usr/lib64/libm.so:       symbolic link to ../../lib64/libm.so.6
/usr/lib64/libpthread.so: ASCII text
It looks like only libm.so was affected:

Code:
# file $(file $(find . -type f -iname "*.so") |grep -v 'ELF 64-bit LSB shared object' |gawk -F ':' '{ gsub( /^./, "", $1 ) ; print $1 }') |gawk -F ':' '{ printf "#### testing " $1 ": \t" ; RetCode = system( "diff -b " "." $1 " " $1 ) ; if ( RetCode == 0 ){ print "OK" }}'

#### testing /usr/lib64/libc.so:        OK
#### testing /usr/lib64/libm.so:        Binary files ./usr/lib64/libm.so and /usr/lib64/libm.so differ
#### testing /usr/lib64/libpthread.so:  OK
-- kjh
 
Old 08-16-2016, 10:31 AM   #4
Wiser Slacker
Member
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83

Rep: Reputation: Disabled
it is not in the install script doinst.sh and did not come from the gcc- package ...

found it in glibc- package in doinst.sh

Last edited by Wiser Slacker; 08-16-2016 at 10:35 AM.
 
Old 08-16-2016, 10:52 AM   #5
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Sorry Wiser Slacker,

That's what I meant in Post #2 -- the install/doinst.sh script from the glibc Package is overwriting the linker script file as a symlink.

See lines 148 and 149.

EDIT: p.s. the fix looks about the same as for libpthread.so at lines 138 and 139

-- kjh

# one way to print install/doinst.sh with numbered lines.
#
# cd /tmp/glibc-2.23 ; gawk '{ printf( "%3d: %s\n", FNR, $0 )}' install/doinst.sh

Code:
  1: #!/bin/sh
  2: # Copyright (C) 2002, 2005  Slackware Linux, Inc.
  3: # Copyright 2005, 2006, 2007, 2011, 2012  Patrick J. Volkerding, Sebeka, Minnesota, USA
  4: #
  5: # This program is free software; you can redistribute it and/or
  6: # modify it under the terms of the GNU General Public License
  7: # as published by the Free Software Foundation; either version 2
  8: # of the License, or (at your option) any later version.
  9: #
 10: # This program is distributed in the hope that it will be useful,
 11: # but WITHOUT ANY WARRANTY; without even the implied warranty of
 12: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13: # GNU General Public License for more details.
 14: #
 15: # Swap glibc on the fly.
 16: #
 17: # If we're on a running system we have to handle this _very_ carefully.  :-)
 18: # The tricks involved here get trickier every time...
 19: 
 20: # OK, now we have to be sure of a few things.  First, you do have a 2.6
 21: # kernel running, right?
 22: 
 23: if [ -r /proc/ksyms ]; then
 24:   echo "FATAL: you need to be running a 2.6.x kernel in order to upgrade"
 25:   echo "to this version of glibc."
 26:   echo
 27:   sleep 999
 28:   exit 1
 29: fi
 30: 
 31: # Next, stop using the /lib64/ntpl libraries.  These are now obsolete and
 32: # will break the installation if present:
 33: if [ -d lib64/tls ]; then
 34:   mkdir -p lib64/obsolete
 35:   mv lib64/tls lib64/obsolete
 36: fi
 37: if [ -x sbin/ldconfig ]; then
 38:   sbin/ldconfig -r .
 39: fi
 40: 
 41: # Install NPTL glibc libraries:
 42: if [ -x /sbin/ldconfig -a -d lib64/incoming ]; then # swap on the fly
 43:   # First create copies of the incoming libraries:
 44:   ( cd lib64/incoming
 45:     for file in * ; do
 46:       if [ ! -r ../${file}.incoming ]; then
 47:         cp -a $file ../${file}.incoming
 48:       fi
 49:     done
 50:   )
 51:   # Then switch to them all at once:
 52:   /sbin/ldconfig -l lib64/*.incoming 2> /dev/null
 53:   # Finally, rename them and clean up:
 54:   ( cd lib64
 55:     for file in *.incoming ; do
 56:       rm -f `basename $file .incoming`
 57:       cp -a $file `basename $file .incoming`
 58:       /sbin/ldconfig -l `basename $file .incoming`
 59:       rm -f $file
 60:     done
 61:   )
 62: else # no ldconfig?  Good, it's safe to just jam it on home (and make links below):
 63:   ( cd lib64/incoming
 64:     for file in * ; do
 65:       cp -a $file ..
 66:     done
 67:   )
 68: fi
 69: # Now, get rid of the temporary directory:
 70: rm -rf lib64/incoming
 71: # Done installing NPTL glibc libraries.
 72: 
 73: # Handle config files:
 74: config() {
 75:   NEW="$1"
 76:   OLD="$(dirname $NEW)/$(basename $NEW .new)"
 77:   # If there's no config file by that name, mv it over:
 78:   if [ ! -r $OLD ]; then
 79:     mv $NEW $OLD
 80:   elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
 81:     rm $NEW
 82:   fi
 83:   # Otherwise, we leave the .new copy for the admin to consider...
 84: }
 85: config etc/nscd.conf.new
 86: config etc/profile.d/glibc.csh.new
 87: config etc/profile.d/glibc.sh.new
 88: # Clearly you already decided this issue.  :-)
 89: rm -f etc/profile.d/glibc.csh.new
 90: rm -f etc/profile.d/glibc.sh.new
 91: 
 92: # In case there's no ldconfig, make the links manually:
 93: if [ ! -x /sbin/ldconfig ]; then
 94: ( cd lib64 ; rm -rf libnss_nis.so.2 )
 95: ( cd lib64 ; ln -sf libnss_nis-2.23.so libnss_nis.so.2 )
 96: ( cd lib64 ; rm -rf libm.so.6 )
 97: ( cd lib64 ; ln -sf libm-2.23.so libm.so.6 )
 98: ( cd lib64 ; rm -rf libnss_files.so.2 )
 99: ( cd lib64 ; ln -sf libnss_files-2.23.so libnss_files.so.2 )
100: ( cd lib64 ; rm -rf libresolv.so.2 )
101: ( cd lib64 ; ln -sf libresolv-2.23.so libresolv.so.2 )
102: ( cd lib64 ; rm -rf libnsl.so.1 )
103: ( cd lib64 ; ln -sf libnsl-2.23.so libnsl.so.1 )
104: ( cd lib64 ; rm -rf libutil.so.1 )
105: ( cd lib64 ; ln -sf libutil-2.23.so libutil.so.1 )
106: ( cd lib64 ; rm -rf libnss_compat.so.2 )
107: ( cd lib64 ; ln -sf libnss_compat-2.23.so libnss_compat.so.2 )
108: ( cd lib64 ; rm -rf libthread_db.so.1 )
109: ( cd lib64 ; ln -sf libthread_db-1.0.so libthread_db.so.1 )
110: ( cd lib64 ; rm -rf libnss_hesiod.so.2 )
111: ( cd lib64 ; ln -sf libnss_hesiod-2.23.so libnss_hesiod.so.2 )
112: ( cd lib64 ; rm -rf libanl.so.1 )
113: ( cd lib64 ; ln -sf libanl-2.23.so libanl.so.1 )
114: ( cd lib64 ; rm -rf libcrypt.so.1 )
115: ( cd lib64 ; ln -sf libcrypt-2.23.so libcrypt.so.1 )
116: ( cd lib64 ; rm -rf libBrokenLocale.so.1 )
117: ( cd lib64 ; ln -sf libBrokenLocale-2.23.so libBrokenLocale.so.1 )
118: ( cd lib64 ; rm -rf ld-linux-x86-64.so.2 )
119: ( cd lib64 ; ln -sf ld-2.23.so ld-linux-x86-64.so.2 )
120: ( cd lib64 ; rm -rf libdl.so.2 )
121: ( cd lib64 ; ln -sf libdl-2.23.so libdl.so.2 )
122: ( cd lib64 ; rm -rf libnss_dns.so.2 )
123: ( cd lib64 ; ln -sf libnss_dns-2.23.so libnss_dns.so.2 )
124: ( cd lib64 ; rm -rf libpthread.so.0 )
125: ( cd lib64 ; ln -sf libpthread-2.23.so libpthread.so.0 )
126: ( cd lib64 ; rm -rf libnss_nisplus.so.2 )
127: ( cd lib64 ; ln -sf libnss_nisplus-2.23.so libnss_nisplus.so.2 )
128: ( cd lib64 ; rm -rf libc.so.6 )
129: ( cd lib64 ; ln -sf libc-2.23.so libc.so.6 )
130: ( cd lib64 ; rm -rf librt.so.1 )
131: ( cd lib64 ; ln -sf librt-2.23.so librt.so.1 )
132: fi
133: 
134: # More links:
135: ( cd usr/lib64 ; rm -rf libnss_nisplus.so )
136: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_nisplus.so.2 libnss_nisplus.so )
137: # This is now a linker script:
138: #( cd usr/lib64 ; rm -rf libpthread.so )
139: #( cd usr/lib64 ; ln -sf ../../lib64/libpthread.so.0 libpthread.so )
140: ( cd usr/lib64 ; rm -rf libresolv.so )
141: ( cd usr/lib64 ; ln -sf ../../lib64/libresolv.so.2 libresolv.so )
142: ( cd usr/lib64 ; rm -rf libnsl.so )
143: ( cd usr/lib64 ; ln -sf ../../lib64/libnsl.so.1 libnsl.so )
144: ( cd usr/lib64 ; rm -rf libnss_hesiod.so )
145: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_hesiod.so.2 libnss_hesiod.so )
146: ( cd usr/lib64 ; rm -rf libnss_files.so )
147: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_files.so.2 libnss_files.so )
148: ( cd usr/lib64 ; rm -rf libm.so )
149: ( cd usr/lib64 ; ln -sf ../../lib64/libm.so.6 libm.so )
150: ( cd usr/lib64 ; rm -rf libutil.so )
151: ( cd usr/lib64 ; ln -sf ../../lib64/libutil.so.1 libutil.so )
152: ( cd usr/lib64 ; rm -rf libnss_compat.so )
153: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_compat.so.2 libnss_compat.so )
154: ( cd usr/lib64 ; rm -rf libthread_db.so )
155: ( cd usr/lib64 ; ln -sf ../../lib64/libthread_db.so.1 libthread_db.so )
156: ( cd usr/lib64 ; rm -rf libcrypt.so )
157: ( cd usr/lib64 ; ln -sf ../../lib64/libcrypt.so.1 libcrypt.so )
158: ( cd usr/lib64 ; rm -rf libBrokenLocale.so )
159: ( cd usr/lib64 ; ln -sf ../../lib64/libBrokenLocale.so.1 libBrokenLocale.so )
160: ( cd usr/lib64 ; rm -rf libdl.so )
161: ( cd usr/lib64 ; ln -sf ../../lib64/libdl.so.2 libdl.so )
162: ( cd usr/lib64 ; rm -rf libnss_dns.so )
163: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_dns.so.2 libnss_dns.so )
164: ( cd usr/lib64 ; rm -rf librt.so )
165: ( cd usr/lib64 ; ln -sf ../../lib64/librt.so.1 librt.so )
166: ( cd usr/lib64 ; rm -rf libanl.so )
167: ( cd usr/lib64 ; ln -sf ../../lib64/libanl.so.1 libanl.so )
168: ( cd usr/lib64 ; rm -rf libnss_nis.so )
169: ( cd usr/lib64 ; ln -sf ../../lib64/libnss_nis.so.2 libnss_nis.so )
170: ( cd usr/share/zoneinfo ; rm -rf localtime )
171: ( cd usr/share/zoneinfo ; ln -sf /etc/localtime localtime )
172: ( cd bin ; rm -rf sln )
173: ( cd bin ; ln -sf /sbin/sln sln )
174: 
175: # Reload to prevent init from holding a stale handle to glibc on shutdown:
176: if [ -x /sbin/telinit ]; then
177:   /sbin/telinit u
178: fi

Last edited by kjhambrick; 08-16-2016 at 10:55 AM. Reason: add p.s.
 
Old 08-16-2016, 11:14 AM   #6
Wiser Slacker
Member
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83

Rep: Reputation: Disabled
i am old - i have to write it down

and i have had the wrong package - you are right ...

but who takes these things into distro - hope someone would read that ...

Last edited by Wiser Slacker; 08-16-2016 at 11:17 AM.
 
Old 08-16-2016, 11:44 AM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Wiser Slacker --

Pat and his crew watch LQ and I imagine someone will see this thread and issue a patched Package.

I've already fixed /usr/lib64/libm.so on my system by replacing the symlink with the linker script.

I tested it with the test program guanx posted on Sourceware Bugzilla – Bug 20469

His test program failed to compile on my un-altered 14.2 exactly like he showed in the other site.

After fixing /usr/lib64/libm.so it worked as expected.

-- kjh
 
Old 08-16-2016, 12:06 PM   #8
Toutatis
Member
 
Registered: Feb 2013
Posts: 412

Rep: Reputation: Disabled
I have slackware64-current
Why did not I never had problems when linking many times with "-lm", but it fails with the test program in https://sourceware.org/bugzilla/show_bug.cgi?id=20469 ?
 
Old 08-16-2016, 12:19 PM   #9
khronosschoty
Member
 
Registered: Jul 2008
Distribution: Slackware
Posts: 648
Blog Entries: 2

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
So whats the fix here I keep reading through but I'm not sure what the immediate fix is?
 
Old 08-16-2016, 12:36 PM   #10
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by Toutatis View Post
I have slackware64-current
Why did not I never had problems when linking many times with "-lm", but it fails with the test program in https://sourceware.org/bugzilla/show_bug.cgi?id=20469 ?
Toutatis --

The compiler flags and pragmas in guanx's test program invoked some rather esoteric parallel programming code.

Try `man gcc` -- each of guanx's gcc -f flags and the #pragmas in his C-Program are in the man page and there is also a reference to The OpenMP® API specification for parallel programming in `man gcc`.

Not something you'll see every day but when you need it, you need it

-- kjh
 
Old 08-16-2016, 12:41 PM   #11
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by khronosschoty View Post
So whats the fix here I keep reading through but I'm not sure what the immediate fix is?
khronosschoty --

You may not need an immediate fix.

If not, it might be safer to wait for Pat's Patch.

If you need it, you could replace the symlink /usr/lib64/libm.so with a text file that contains the code in guanx's Post #1.

-- kjh
 
1 members found this post helpful.
Old 08-06-2017, 09:21 PM   #12
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,179

Original Poster
Rep: Reputation: 236Reputation: 236Reputation: 236
I vaguely remember this bug has been fixed quite a while ago but with glibc-2.23-x86_64-3_slack14.2 it came back.
 
Old 08-10-2017, 02:13 AM   #13
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,179

Original Poster
Rep: Reputation: 236Reputation: 236Reputation: 236
Quote:
patches/packages/glibc-2.23-x86_64-4_slack14.2.txz: Rebuilt.
Fixed a regression with the recent glibc patch packages:
Don't clobber the libm.so linker script with a symlink.
Thanks for the fix!

Last edited by guanx; 08-11-2017 at 05:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug with Slackware64-14.1 and Grub2(UEFI) aaditya Slackware 3 12-11-2013 02:12 AM
Slackware64-current GPG Bug t35t Slackware 6 08-30-2012 05:56 AM
[SOLVED] Slackware64-Current Bug in lxc 0.7.5 Jack128 Slackware 7 08-25-2012 12:53 PM
Bug in Slackware64 version of yp-tools kikinovak Slackware 7 07-08-2011 04:56 AM
Bug#314905 bug fix for Ubuntu and gcc is 4.4.1 bostan Linux - General 1 12-11-2010 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration